package com.qinghua.blog.service;

import com.qinghua.blog.dao.UserRepostory;
import com.qinghua.blog.po.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class UserServiceImpl implements UserService{

    @Autowired
    UserRepostory userRepostory;

    @Transactional
    @Override
    public User checkUser(String username, String password) {
        User user=userRepostory.findByUsernameAndPassword(username,password);
        if(user!=null){
            return user;
        }
        return null;
    }
}
